﻿'Public Class CardPresenter

'    Dim IQuizEngine As QuizEngine.IQuizEngine

'    Sub InitializeQuiz(ByVal quizFile As String)
'        IQuizEngine = New QuizEngine.Quiz(quizFile)
'    End Sub


'    Public Sub Submit_Handler(ByVal page As QuizEngineMobile._Default)
'        'page.Question
'        GetNextCard(page)
'    End Sub

'    Public Sub Validate_Handler(ByVal page As QuizEngineMobile._Default)
'        Dim quizcard As QuizEntities.QuizCard = page.Card
'        InitializeQuiz(page.Quiz_Id)
'        If IQuizEngine.ValidateAnswer(quizcard) = page.SelectedAnswer Then
'            quizcard.Status.IsCorrectAnswered = True
'            quizcard.Status.IsAnswered = True
'            quizcard.Status.CorrectQuestionCount = quizcard.Status.CorrectQuestionCount + 1
'            page.showAnswer(quizcard)
'        Else
'            quizcard.Status.IsAnswered = True
'            quizcard.Status.IsCorrectAnswered = False
'            'quizcard.Status.Score = quizcard.Status.Score + 1
'            page.showAnswer(quizcard)
'        End If
'        'quizcard.Status.IsCorrectAnswered = 

'    End Sub


'    Public Sub GetNextCard(ByVal page As QuizEngineMobile._Default)
'        Dim quizcard As QuizEntities.QuizCard = page.Card
'        InitializeQuiz(page.Quiz_Id) ' this line needs a review, as the argument passed was just to supress error.



'        ' '' ''If Not quizcard.Status.IsLastQuestion Then
'        ' '' ''    If CInt(quizcard.QusestionCard.CorrectAnswer) = CInt(page.Answer) Then
'        ' '' ''        quizcard.Status.IsCorrectAnswered = True
'        ' '' ''        quizcard.Status.Score = quizcard.Status.Score + 1
'        ' '' ''        quizcard.Status.IsAnswered = True
'        ' '' ''    Else
'        ' '' ''        quizcard.Status.IsAnswered = True ' mark answered anyway, if wrong or right
'        ' '' ''    End If
'        ' '' ''End If
'        '#######################''''''''''''''''''''''''''''''''''''''
'        IQuizEngine.SubmitQuestionCardToCache(quizcard)
'        '#######################''''''''''''''''''''''''''''''''''''''
'        quizcard = IQuizEngine.GetNextQuestion(quizcard)

'        If quizcard.Status.IsLastQuestion Then
'            page.ShowResults(quizcard)
'            Exit Sub
'        End If

'        'Session("card") = quizCard
'        page.ShowQuestionCard(quizcard)
'        'ShowQuestionCard(quizcard)
'    End Sub

'    Public Function GetFirstCard(ByVal quizFile As String) As QuizEntities.QuizCard
'        Dim quizcard As New QuizEntities.QuizCard()
'        quizcard.QuizUniqueId = quizFile
'        InitializeQuiz(quizFile)
'        Return IQuizEngine.GetNextQuestion(quizcard)
'    End Function

'End Class
